/**
 *  example1.vala
 *
 *  Copyright (c) 2007 INdT (Instituto Nokia de Technologia)
 *                2007 Marcelo Lira dos Santos <setanta@gmail.com>
 *
 *  Author: Marcelo Lira dos Santos <setanta@gmail.com>
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License as
 *  published by the Free Software Foundation; either version 2 of the
 *  License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 *  USA
 */

using GLib;
using Gtk;
using Hildon;

public class Example1 : Hildon.Window
{
    [Widget] protected Label label1;
    [Widget] protected Button button1;

    construct {
        label1 = new Label("Don't press the button!");

        button1 = new Button.from_stock("gtk-no");
        button1.set_size_request(-1, 100);
        button1.clicked += btn => {
            label1.label = "I told you not to press the button!";
        };

        var vbox1 = new VBox(false, 4);
        vbox1.pack_start(label1, true, true, 0);
        vbox1.pack_start(button1, false, true, 0);

        add (vbox1);

        destroy += Gtk.main_quit;
    }

    static int main (string[] args) {
        Gtk.init(out args);

        Environment.set_application_name("Sample 1");

        Example1 ex1 = new Example1();

        Hildon.Program program = Hildon.Program.get_instance();

        program.add_window((Hildon.Window) ex1);

        ex1.show_all();

        Gtk.main();

        return 0;
    }
}
